<div appBsModal #modal="bs-modal" class="modal fade" [ngClass]="modalExpandOb.className"  tabindex="-1" role="dialog" aria-labelledby="modal"
    aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header" style="padding:0.5rem">
                <h5 class="modal-title">
                    <span>{{title}}</span>
                </h5>
                <span class="pull-right">
                    <a class="btn btn-smallEx" (click)='modalExpandOb.modalExHandle("small")'>
                        <i class="bi bi-arrows-angle-expand" *ngIf="!modalExpandOb.isSmallEx"></i>
                        <i class="bi bi-arrows-angle-contract" *ngIf="modalExpandOb.isSmallEx"></i>
                    </a>
                    <a class="btn btn-fullscreen" (click)='modalExpandOb.modalExHandle("full")'>
                        <i class="bi bi-arrows-fullscreen" *ngIf="!modalExpandOb.isFullScreen"></i>
                        <i class="bi bi-fullscreen-exit" *ngIf="modalExpandOb.isFullScreen"></i>
                    </a>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <i aria-hidden="true" class="bi bi-x"></i>
                    </button>
                </span>
            </div>
            <div class="modal-body"  [busyIf]="loading">
                <tabset class="ui-tabs-nav">
                    <tab  class="pt-3" heading="{{'General' | localize}}">
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <label>{{"Name" | localize}}</label>
                                    <input class="form-control" type="text" [ngClass]="{'edited':data.displayName}" [(ngModel)]="data.displayName" name="displayName" required maxlength="50" />
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <label>{{"Url" | localize}}</label>
                                    <input class="form-control" type="text" [ngClass]="{'edited':data.url}" [(ngModel)]="data.url" name="url" required maxlength="300" />
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-6">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <label>{{"TagName" | localize}}</label>
                                    <select class="form-control edited" [(ngModel)]="data.name" name="name"  (change)="moduleChanged()">
                                        <option value="{{op.name}}" *ngFor="let op of moduleDefinitions" >{{op.displayName}}</option>
                                    </select>                                
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <label>{{"Target" | localize}}</label>
                                    <select class="form-control edited" [(ngModel)]="data.target" name="target" >
                                        <option value="">{{'EmptyOnes'| localize}}</option>
                                        <option value="_blank">_blank</option>
                                    </select>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-6">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <label>{{"Icon" | localize}}</label>
                                    <input class="form-control" type="text" [ngClass]="{'edited':data.icon}" [(ngModel)]="data.icon" name="icon" maxlength="50" />
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <div>&nbsp;</div>
                                    <button  [disabled]="saving" type="button" class="btn btn-primary blue" (click)="lookupConfig()">选择自定义配置</button>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-12">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <label>{{"CustomData" | localize}}</label>
                                    <textarea class="form-control" [ngClass]="{'edited':data.customData}"  rows="4" [(ngModel)]="data.customData" name="customData" maxlength="500" ></textarea>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-12">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <label>{{"Description" | localize}}</label>
                                    <textarea class="form-control" [ngClass]="{'edited':data.description}"  rows="4" [(ngModel)]="data.description" name="description" maxlength="250" ></textarea>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-6">
                                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                    <label>{{"Order" | localize}}</label>
                                    <input class="form-control edited" type="number" [(ngModel)]="data.order" name="order" min='1' step='1' />
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="checkbox-list">
                                    <label class="checkbox">
                                        <input id="EditModule_isActive" type="checkbox" name="isActive" [(ngModel)]="data.isActive" >
                                        <span></span>
                                        {{"ReleaseState" | localize}}
                                    </label>
                                </div>
                            </div>
                        </div>
                    </tab>
                    <tab  class="pt-3" heading="{{ l('Features')+'(readonly)'}}">
                        <div class="checkbox-list">
                            <div class="form-group" >
                                <label for="EditModule_requiresAll" class="checkbox">
                                    <input id="EditModule_requiresAll" type="checkbox"
                                        name="requiresAll"
                                        [(ngModel)]="data.requiresAll" readonly>
                                    <span></span>
                                    {{"RequiresAll" | localize}}
                                </label>
                                <span class="form-text text-muted">{{"RequiresAllTooltip" | localize}}</span>
                            </div>
                        </div>
                        <feature-tree-readonly #featureTree></feature-tree-readonly>
                    </tab>
                </tabset>
            </div>
            <div class="modal-footer">
                <button [disabled]="saving" type="button" class="btn btn-default font-weight-bold"
                        (click)="close()">
                    {{"Cancel" | localize}}
                </button>
                <button *ngIf="['Pages.Administration.BackendPage.Create', 'Pages.Administration.BackendPage.Edit'] | permissionAny" 
                   class="btn btn-primary blue"  [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')" (click)="save()">
                   <i class="fa fa-save"></i>{{"Save" | localize}}
                </button>
            </div>
        </div>
    </div>
</div>
<lookup-content-config-modal #LookupContentConfigModal (callback)="lookupCallback($event)"></lookup-content-config-modal>